import axios from 'axios';
// 获取所有菜单
let all = (params) => axios.get('/menu/all', { params });
// 获取子级菜单
let sub = (params) => axios.get('/menu/sub', { params });
//更新菜单
let edit=(menu_id,data) => axios.put(`/menu/${menu_id}`, data);
// 添加菜单
let add = (data) => axios.post('/menu', data);
// 给菜单页面添加新的操作按钮
let add_oper = (data) => axios.post('/menu/operation', data);
//编辑操作按钮
let edit_oper=(permission_id,data) => axios.put(`/menu/operation/${permission_id}`, data);
//设置菜单图标
let edit_icon=(menu_id,data) => axios.put(`/menu/icon/${menu_id}`, data);
//删除菜单
let remove = (menu_id,params) => axios.delete(`/menu/${menu_id}`, {params});
//删除指定id的操作按钮
let remove_oper = (permission_id,params) => axios.delete(`/menu/operation/${permission_id}`, {params});
export default {
	all,
    sub,
	edit,
	add,
	add_oper,
	edit_oper,
	remove,
	remove_oper,
    edit_icon
}